/* 全局样式 */
:root {
    --primary-color: #6a4cff;
    --secondary-color: #ff5e94;
    --tertiary-color: #4cd9ff;
    --background-color: #f8f9fd;
    --card-bg-color: #ffffff;
    --text-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hover-color: #f0f2ff;
    --border-radius: 12px;
    --transition-speed: 0.3s;
}

/* 页面加载动画 */
body {
    opacity: 0;
    transition: opacity 1s ease;
}

body.loaded {
    opacity: 1;
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader-icon {
    font-size: 3rem;
    color: white;
    margin-bottom: 20px;
    animation: bounce 1.5s ease infinite alternate;
}

.loader-text {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 25px;
    font-weight: 500;
    letter-spacing: 1px;
    animation: fadeInOut 2s ease infinite;
}

@keyframes bounce {
    from {
        transform: translateY(0px);
    }
    to {
        transform: translateY(-15px);
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 现有样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    padding: 30px 0;
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: 0 5px 15px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

/* 添加背景动态效果 */
header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    animation: rotate 20s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.logo {
    font-size: 2.5rem;
    margin-right: 15px;
    color: white;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2), inset 0 -3px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.logo::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: -1;
    opacity: 0.5;
}

.logo i {
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
    100% {
        transform: scale(1);
    }
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 20px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* 搜索栏 */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

#search-input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 30px 0 0 30px;
    font-size: 1rem;
    outline: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed);
}

#search-input:focus {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

#search-btn {
    background: white;
    border: none;
    padding: 0 20px;
    border-radius: 0 30px 30px 0;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 1.2rem;
    transition: all var(--transition-speed);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

#search-btn:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
}

/* 过滤按钮 */
.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-size: 0.9rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.filter-btn:hover, .filter-btn.active {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* 游戏网格 */
.games-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.game-card {
    background: var(--card-bg-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all var(--transition-speed);
    cursor: pointer;
    position: relative;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px var(--shadow-color);
}

.game-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

.game-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.7));
    transition: all 0.5s ease;
}

.game-card:hover .game-image {
    transform: scale(1.05);
}

.game-info {
    padding: 20px;
    position: relative;
}

.game-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
    transition: all var(--transition-speed);
}

.game-card:hover .game-title {
    color: var(--primary-color);
}

.game-category {
    position: absolute;
    top: -15px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed);
}

.game-card:hover .game-category {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.game-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.play-btn {
    display: inline-block;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-speed);
    text-align: center;
    box-shadow: 0 3px 8px rgba(106, 76, 255, 0.2);
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(106, 76, 255, 0.3);
}

/* 页脚样式 */
footer {
    margin-top: 50px;
    padding: 30px 0;
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    animation: rotate 20s linear infinite;
    z-index: 0;
    pointer-events: none;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    color: white;
    font-size: 1.5rem;
    transition: all var(--transition-speed);
}

.social-link:hover {
    transform: translateY(-5px);
    color: var(--tertiary-color);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
    transition: all 0.3s ease;
}

.modal-content {
    background-color: var(--card-bg-color);
    margin: 5% auto;
    padding: 30px;
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.4s;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-btn {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: all var(--transition-speed);
}

.close-btn:hover {
    color: var(--text-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px 0;
}

#modal-title {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.8rem;
    position: relative;
    display: inline-block;
}

#modal-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

#modal-title:hover::after {
    width: 100%;
}

.game-preview {
    height: 300px;
    background-size: cover;
    background-position: center;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all 0.5s ease;
    transform: scale(1);
}

.game-preview:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px var(--shadow-color);
}

#modal-description {
    margin-bottom: 25px;
    line-height: 1.8;
    color: #555;
}

#modal-link {
    display: inline-block;
    padding: 12px 25px;
    font-size: 1.1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .games-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .logo {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .games-container {
        grid-template-columns: 1fr;
    }
    
    .filter-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        justify-content: flex-start;
    }
    
    .filter-btn {
        flex: 0 0 auto;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

/* 无游戏提示样式 */
.no-games {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: #666;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px var(--shadow-color);
} 